home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
4cmp22s.zip
/
UNSCREEN.4TH
< prev
next >
Wrap
Text File
|
1994-10-30
|
1KB
|
55 lines
\ UNSCREEN PROGRAM, BY TOM ALMY.
\ THIS PROGRAM IS COPYRIGHT (C) 1985 BY TOM ALMY,
\ ALL RIGHTS RESERVED.
\ Permission is granted to registered users of ForthCMP to sell or distribute
\ computer programs incorporating the compiled contents of this file.
\ YOU MIGHT ALSO WANT TO MAKE THIS SMARTER, LIKE DELETING
\ EXTRA BLANK LINES, "-->" COMMANDS, START ON SCREEN 1 OR 2...
100 MSDOS
SCONSTANT SDEFSTR SCR" ( SOURCE DEFAULTS TO .SCR )
SCONSTANT DDEFSTR 4TH" ( DESTINATION DEFAULTS TO .4TH )
16384 CONSTANT BUFSIZ
INCLUDE FILTER
0 1 IN/OUT
: UNSCREEN? ( -- successflag )
HERE 64 ACCEPT ( get a line )
DUP 0> IF ( got one )
HERE SWAP -TRAILING TYPE CR
TRUE
ELSE
DROP FALSE
THEN
;
0 0 IN/OUT
: NOTICE CONSOLE CR
." FORTH UN-SCREEN CONVERSION PROGRAM " CR
." COPYRIGHT (C) 1985 BY THOMAS ALMY " CR ;
0 0 IN/OUT
: USAGE CONSOLE
." USAGE: UNSCREEN [SCRFILE] [TXTFILE] " CR
." where SCRFILE (default .SCR) is a file of Forth screens" CR
." if absent or `-' then standard input is used" CR
." and TXTFILE (default .4TH) is output file." CR
ABORT
;
: MAIN
SETBUFS ( allows I/O )
NOTICE ( Welcome Message )
SETFILES IF USAGE THEN ( Indicate failure )
OPTIONSTRING CELL+ @ IF USAGE THEN
BEGIN UNSCREEN? 0= UNTIL
BYE ;
INCLUDE DOS2
INCLUDE FORTHLIB
END